package com.github.jiangxch.rpc.transport.netty;

import com.github.jiangxch.rpc.serialization.Serializer;
import com.github.jiangxch.rpc.transport.ChannelHandler;
import com.github.jiangxch.rpc.transport.Client;
import com.github.jiangxch.rpc.transport.Server;
import com.github.jiangxch.rpc.transport.Transporter;
import java.net.InetSocketAddress;

/**
 * @author: jiangxch
 * @date: 2021/2/20 11:09
 */
public class NettyTransporter implements Transporter {
    @Override
    public Server bind(InetSocketAddress address, ChannelHandler channelHandler, Serializer serializer) {
        return new NettyServer(address,channelHandler,serializer);
    }

    @Override
    public Client connect(InetSocketAddress address, ChannelHandler channelHandler, Serializer serializer) {
        return new NettyClient(address,channelHandler,serializer);
    }
}
